<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>项目生成器</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/assets/module/admin.css?v=318"/>
    <link rel="stylesheet" href="/static/assets/css/gen.css"/>
    <link rel="stylesheet" href="/static/assets/css/table.css"/>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    -->
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space20">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">项目生成</div>
                <div class="layui-card-body" style="padding-top: 20px;">
                    <div class="layui-tab layui-steps layui-steps-readonly" lay-filter="generatorTab"
                         style="visibility: hidden;">
                        <ul class="layui-tab-title">
                            <li class="layui-this">
                                <i class="layui-icon layui-icon-ok">1</i>
                                <span class="layui-steps-title">第一步</span>
                                <span class="layui-steps-content">数据库连接配置</span>
                            </li>
                            <li>
                                <i class="layui-icon layui-icon-ok">2</i>
                                <span class="layui-steps-title">第二步</span>
                                <span class="layui-steps-content">业务模块划分</span>
                            </li>
                            <li>
                                <i class="layui-icon layui-icon-ok">3</i>
                                <span class="layui-steps-title">第三步</span>
                                <span class="layui-steps-content">表信息自定义配置</span>
                            </li>
                            <li>
                                <i class="layui-icon layui-icon-ok">4</i>
                                <span class="layui-steps-title">第四步</span>
                                <span class="layui-steps-content">项目信息配置</span>
                            </li>
                        </ul>
                        <div class="layui-tab-content">
                            <!-- 第一步 -->
                            <div class="layui-tab-item layui-form layui-show" lay-filter="generatorFrom1">
                                <div class="gen-from-body">
                                    <!--<div class="layui-form-item" style="margin-top: 50px;">
                                        <label class="layui-form-label layui-form-required">连接地址:</label>
                                        <div class="layui-input-block">
                                            <input name="url" class="layui-input" placeholder="请输入数据库连接地址"
                                                   value="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8"
                                                   lay-verify="required" required/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">连接账号:</label>
                                        <div class="layui-input-block">
                                            <input name="username" value="root" class="layui-input"
                                                   placeholder="请输入数据库连接账号"/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">连接密码:</label>
                                        <div class="layui-input-block">
                                            <input name="password" value="123456" class="layui-input"
                                                   placeholder="请输入数据库连接密码" lay-verify="required" required/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">连接驱动:</label>
                                        <div class="layui-input-block">
                                            <input name="driverName" value="com.mysql.cj.jdbc.Driver"
                                                   placeholder="请输入数据库连接驱动名"
                                                   class="layui-input" lay-verify="required" required/>
                                        </div>
                                    </div>-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">数据源:</label>
                                        <div class="layui-input-block">
                                            <select name="dscId" lay-verify="required" required>
                                                <option value="">请选择数据源</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <button id="btnGoLast" class="layui-btn layui-btn-primary">最后一步</button>&emsp;
                                    <button class="layui-btn" lay-filter="generatorSubmit1" lay-submit>下一步</button>
                                </div>
                            </div>
                            <!-- 第二步 -->
                            <div class="layui-tab-item layui-form" lay-filter="generatorFrom2">
                                <div class="gen-from-body">
                                    <div class="layui-form-item" style="margin-top: 25px;">
                                        <button id="btnAddModel" class="layui-btn layui-btn-fluid layui-btn-primary">
                                            <i class="layui-icon">&#xe624;</i>增加模块
                                        </button>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <button data-steps="prev" class="layui-btn layui-btn-primary">上一步</button>&emsp;
                                    <button class="layui-btn" lay-filter="generatorSubmit2" lay-submit>下一步</button>
                                </div>
                            </div>
                            <!--  第三步  -->
                            <div class="layui-tab-item layui-form" lay-filter="generatorFrom3">
                                <div class="gen-from-body-tables">
                                    <!-- 数据表格 -->
                                    <table id="tableTable" lay-filter="tableTable"></table>
                                </div>
                                <div class="layui-form-item">
                                    <button data-steps="prev" class="layui-btn layui-btn-primary">上一步</button>&emsp;
                                    <button class="layui-btn" lay-filter="generatorSubmit3" lay-submit>下一步</button>
                                </div>
                            </div>

                            <!-- 第四步 -->
                            <div class="layui-tab-item layui-form" lay-filter="generatorFrom4">
                                <div class="gen-from-body">
                                    <div class="gen-form-header"><span>项目信息</span></div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">项目名称:</label>
                                        <div class="layui-input-block">
                                            <input name="projectName" class="layui-input" placeholder="例如: javabb-cms"
                                                   lay-verify="required" required/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">Group Id:</label>
                                        <div class="layui-input-block">
                                            <input name="groupId" class="layui-input" placeholder="例如: cn.javabb"
                                                   value="cn.javabb" lay-verify="required" required/>
                                            <div class="layui-form-mid layui-word-aux">GroupId建议统一为公司域名</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">项目包名:</label>
                                        <div class="layui-input-block">
                                            <input name="packageName" class="layui-input" placeholder="例如: cn.javabb"
                                                   value="cn.javabb" lay-verify="required" required/>
                                        </div>
                                    </div>
                                    <div class="gen-form-header"><span>其它配置</span></div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">作者名称:</label>
                                        <div class="layui-input-block">
                                            <input name="author" class="layui-input" placeholder="请输入作者名称"
                                                   value="Javabb" lay-verify="required" required/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">框架模板:</label>
                                        <div class="layui-input-block">
                                            <select name="templateId" lay-verify="required" required>
                                                <option value="">请选择框架模板</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">权限注解:</label>
                                        <div class="layui-input-block">
                                            <input type="radio" name="needPerm" value="true" title="需要" checked/>
                                            <input type="radio" name="needPerm" value="false" title="不需要"/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">swagger注解:</label>
                                        <div class="layui-input-block">
                                            <input type="radio" name="needSwagger" value="true" title="需要" checked>
                                            <input type="radio" name="needSwagger" value="false" title="不需要"/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">日志注解:</label>
                                        <div class="layui-input-block">
                                            <input type="radio" name="needLog" value="true" title="需要" checked>
                                            <input type="radio" name="needLog" value="false" title="不需要"/>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label layui-form-required">菜单起始ID:</label>
                                        <div class="layui-input-block">
                                            <input name="menuStartId" class="layui-input" placeholder="请输入菜单起始ID"
                                                   type="number" value="37" lay-verify="required|number" required/>
                                            <div class="layui-form-mid layui-word-aux">用于生成菜单表的sql语句</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <button data-steps="prev" class="layui-btn layui-btn-primary">上一步</button>&emsp;
                                    <button class="layui-btn" lay-filter="generatorSubmit4" lay-submit>立即生成</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 模块划分item渲染模板 -->
<script type="text/html" id="tplStep2Item">
    <div class="gen-from-body model-item" data-index="{{d.modelIndex}}">
        <div class="gen-form-header"><span>业务模块</span></div>
        <div class="dropdown-menu">
            <i class="layui-icon">&#x1006;</i>
            <div class="dropdown-menu-nav dropdown-popconfirm dropdown-bottom-right">
                <div class="dropdown-anchor"></div>
                <div class="dropdown-popconfirm-title">
                    <i class="layui-icon layui-icon-help"></i>
                    确定要删除此模块吗？
                </div>
                <div class="dropdown-popconfirm-btn">
                    <button class="layui-btn" btn-cancel>取消</button>
                    <button ew-event="closeCard" class="layui-btn">确定</button>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">模块名:</label>
            <div class="layui-input-block">
                <input name="model_{{d.modelIndex}}" class="layui-input" placeholder="例如: system"/>
                <div class="layui-form-mid layui-word-aux">可为空,以字母命名,不要以数字开头</div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">模块的表:</label>
            <div class="layui-input-block" id="table_{{d.modelIndex}}"></div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">表前缀:</label>
            <div class="layui-input-block">
                <input name="table_prefix_{{d.modelIndex}}" class="layui-input" placeholder="例如: sys_"/>
            </div>
        </div>
    </div>
</script>
<!-- 表格操作列 -->
<script type="text/html" id="tableTbBar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">预览</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="reset">生成代码</a>
</script>
<!-- js部分 -->
<script type="text/javascript" src="/static/assets/libs/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/static/assets/js/common.js?v=100"></script>
<script type="text/javascript" src="/static/assets/js/ajaxUtil.js?v=100"></script>
<script type="text/javascript" src="/static/assets/js/gen.js?v=100"></script>
<script>

</script>
</body>
</html>